﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace TestGeometry {
    public class Util {
        public static float EPSILON = 1e-3f;

        public static bool almostEquals(float f, float g, float eps) {
            return Math.Abs(f - g) < eps;
        }
        public static bool almostEquals(float f, float g) {
            return almostEquals(f, g, EPSILON);
        }

        public static void assertEquals(float f, float g, float eps) {
            Debug.Assert(almostEquals(f, g, eps));
        }
        public static void assertEquals(float f, float g) {
            assertEquals(f, g, EPSILON);
        }

        public static void assertZero(float f, float eps) {
            assertEquals(f, 0.0f, eps);
        }
        public static void assertZero(float f) {
            assertZero(f, EPSILON);
        }
    }
}
